<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
	
	<h:head>
		<title>Selezione Attività</title>
	</h:head>
	
	<h:body>
		<h:form>
			<p:dataTable var="activity" value="#{activityBean.getFiltered(activityDialogBean.city)}" rows="10"
				paginator="true">
				<p:column headerText="Id">
					<h:outputText value="#{activity.id}" />
				</p:column>
	
				<p:column headerText="Nome">
					<h:outputText value="#{activity.name}" />
				</p:column>
	
				<p:column headerText="Descrizione">
					<h:outputText value="#{activity.description}" />
				</p:column>
	
				<p:column headerText="Prezzo">
					<h:outputText value="#{activity.price}" />
				</p:column>
	
				<p:column headerText="Seleziona">
					<p:commandButton rendered="#{activityDialogBean.selected != activity.id}" value="Seleziona"
						action="#{activityDialogBean.select(activity)}" />
					<h:outputText rendered="#{activityDialogBean.selected == activity.id}" value="Selezionata" />
				</p:column>
			</p:dataTable>
		</h:form>
	</h:body>

</html>